[Main]
Name=Cuff-Teleport Friendly
Author=Carrie O'Kaye, Darkhorse Pterid, and others
D1=Full credits list: Carrie O'Kaye, Darkhorse Pterid, Graphite, tafyrn, GrumbleLion and papez
D2=
D3=Function:
D4=One furre with share (referred to as Captor) will be able to drag another furre around the map.
D5=
D6=To activate the function, Captor says, "cuff."
D7=To deactivate the function, Captor says, "uncuff."
D8=To capture a captive, Captor bumps into a Furre when Cuff is active.
D9=
D10=This version of the Cuff script supports dragging someone through teleports. (Doors and similar)
V1=Cuffing Activated Variable
T1=Variable Name
V2=Captor Position Variable
T2=Variable Name
V3=Captive Position Variable
T3=Variable Name
V4=Captive Position (Old) Variable
T4=Variable Name

[Code]
* SHARED,TELEPORT-FRIENDLY CUFF DS
* Written by Carrie O'Kaye, Darkhorse Pterid, Graphite, tafyrn, GrumbleLion and papez
(0:0) When everything is starting up,
(5:300) set variable %^1^ to the value 0
(5:300) set variable %^2^ to the value 0.

* When the Captor says 'cuff', then enable the trapping mode.
(0:31) When a furre says {cuff},
(1:111) and the triggering furre hasn't got shared control (and is not the dream owner),
(5:200) emit message {You must have Shared Dream Control.} to whoever set off the trigger.

(0:31) When a furre says {cuff},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:200) and variable %^1^ is equal to 1,
(1:1100) and there's a furre at (%^2^),
(5:200) emit message {The cuffs are currently being used.} to whoever set off the trigger.

(0:31) When a furre says {cuff},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:200) and variable %^1^ is equal to 0,
* OR
(0:31) When a furre says {cuff},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1101) and there's no furre at (%^2^),
(5:300) set variable %^1^ to the value 1.
(5:350) set variable %^2^ to the X,Y position the triggering furre (moved from/is standing at).
(5:200) emit message {You now have control of the cuffs.} to whoever set off the trigger.

* When the captor walks into a furre while trapping mode is active, then 'cuff' the Furre.
(0:1) Whenever somebody moves,
(1:4) and they bump into a furre,
(1:19) and they (moved from/are standing at) position (%^2^),
(1:200) and variable %^1^ is equal to 1,
(5:350) set variable %^2^ to the X,Y position the triggering furre (moved from/is standing at).
(5:351) set variable %^3^ to the X,Y position the triggering furre moved to.

* When the captor says 'uncuff' and we're currently 'cuffing' someone, then release this Furre.
(0:31) When a furre says {uncuff},
(1:19) and they (moved from/are standing at) position (%^2^),
(1:200) and variable %^1^ is equal to 1,
(5:300) set variable %^2^ to the value 0.
(5:300) set variable %^3^ to the value 0.
(5:300) set variable %^1^ to the value 0.
(5:200) emit message {You have lost control of the cuffs.} to whoever set off the trigger.

* When the captive tries to move, move him back to where he came from
(0:1) Whenever somebody moves,
(1:19) and they (moved from/are standing at) position (%^3^),
(1:1100) and there's a furre at (%^2^),
(1:200) and variable %^1^ is equal to 1,
(5:18) move the triggering furre back where they came from.

* When the captor moves succesfully, move the captive into the space he just left. Rewritten for teleport.
(0:1) Whenever somebody moves,
(1:5) and they successfully moved,
(1:119) and they (didn't move from/aren't standing at) position (%^3^),
(1:200) and variable %^1^ is equal to 1,
(5:301) copy the value of variable %^3^ into variable %^4^.
(5:301) copy the value of variable %^2^ into variable %^3^.
(5:351) set variable %^2^ to the X,Y position the triggering furre moved to.
(3:2) at position (%^4^) on the map,
(5:16) move any furre present to (%^3^) if there's nobody already there.
